import unittest
from genString import genSizedString


class Test(unittest.TestCase):


    def test_findStringsInBinary(self):
        test1 = "STRINGSTRINGSTRING"
        test2 = "A"
        test3 = "\x00\x00STRINGSTRINGSTRING\x00\x00STRINGSTRING"
        test4 = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        testObj = genSizedString()
        print testObj.findStringsInBinary(test1)
        print testObj.findStringsInBinary(test2)
        print testObj.findStringsInBinary(test3)
        print testObj.findStringsInBinary(test4)

    def test_findSizers(self):
        test1 = "10\x00AAAAAAAAAA\x00\x00"
        test2 = "10AAAAAAAAAAA"
        test3 = "AAAAAAAAAA10"
        
    def test_writeFuzzScript(self):
        test1 = "\x00\x00STRINGSTRINGSTRING\x00\x00STRINGSTRING"
        test2 = "\x00\x06STRING"
        test3 = "\x00\x07STRING\x06\x00\x00\x00"
        generator = genSizedString()
        generator.writeFuzzScripts(test1)
        generator2 = genSizedString()
        generator2.writeFuzzScripts(test2)
        #generator.writeFuzzScripts(test3)

if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testName']
    unittest.main()